package warningreportcount;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class ReportCount implements Writable {
    private String error;
    private int count;

    public ReportCount() {};

    public ReportCount(String error, int count) {
        super();
        this.error = error;
        this.count = count;
    }

    public void setError(String error) {
        this.error = error;
    }

    public String getError() {
        return this.error;
    }

    public void setCount(int count) {
        this.count = count;
    }

    public int getCount() {
        return this.count;
    }

    // 序列化
    public void write(DataOutput dataOutput) throws IOException {
        dataOutput.writeUTF(error);
        dataOutput.writeInt(count);
    }



    // 反序列化
    public void readFields(DataInput dataInput) throws IOException {
        error = dataInput.readUTF();
        count = dataInput.readInt();
    }

    @Override
    public String toString() {
        return error + "\t" + count;
    }


}
